package routes

import (
	"digital/server/controller"
	"digital/server/middleware"
	"github.com/gin-gonic/gin"
)

// 路由信息
func CollectRouter(r *gin.Engine) *gin.Engine {
	r.Use(middleware.CORSMiddleware())
	r.GET("/api/club", controller.GetClubs)                 //进入社团模块时，获取社团信息
	r.POST("/api/club/CollectClub", controller.CollectClub) //收藏或取消社团
	r.GET("/api/activity", controller.GetActivities)        //进入活动模块时，获取活动信息
	r.POST("/api/joinActivity", controller.JoinActivity)
	r.POST("/api/activity/CollectActivity", controller.CollectActivity) //收藏或取消收藏活动
	r.POST("/api/club/JoinClub", controller.JoinClub)
	r.GET("api/club/ClubDetail", controller.GetClubDetail)
	r.POST("/login", controller.Login)
	r.GET("/api/msg", controller.GetAllMesgType)
	r.GET("/api/detail", controller.GetDetail)
	r.GET("/api/getActivityApplies", controller.GetActivityApplies)
	r.POST("/api/saveProfile", controller.SaveUserProfile)
	r.DELETE("api/deletehonor", controller.DeleteHonor)
	r.POST("api/savehonor", controller.SaveHonor)
	r.GET("/api/getApplies", controller.GetApplies)
	r.GET("/api/getCollectedActivities", controller.GetCollectedActivities)
	r.GET("/api/getCollectedClubs", controller.GetCollectedClubs)
	r.GET("/api/getJoinedClubs", controller.GetJoinedClubs)
	r.POST("/api/club/submitForm", controller.JoinClub)
	r.POST("api/club/createClub", controller.CreateClub)
	r.GET("/home", controller.GetAll)
	r.GET("/api/clubManage", controller.ClubManage)
	r.POST("/api/club/modifyClubInfo", controller.ModifyClubInfo)
	r.POST("/api/club/modifyMainImage", controller.UploadHandler)
	r.POST("/api/club/modifyImages", controller.UploadImageHandler)
	r.POST("api/activity/createAct", controller.CreateAct)
	r.GET("api/manager/getActInfo", controller.GetActInfo)
	r.GET("/api/approval/joinClubApplies", controller.GetClubApply)
	r.GET("/api/approval/joinActivityApplies", controller.GetActivityApply)
	r.GET("/api/approval/CreateClubApplies", controller.GetCreateClub)
	r.GET("/api/approval/CreateActivityApplies", controller.GetCreateActivity)
	r.GET("/api/approval/ASApplies", controller.GetAS)
	r.GET("/api/approval/CEApplies", controller.GetCE)
	r.GET("/api/approval/QuitClubApplies", controller.GetQuitClubApply)
	r.POST("/api/approval/ApproveApplies", controller.ApproveApply)
	r.GET("/api/file/downloadfile", controller.DownloadFile)
	r.POST("/api/file/uploadfile", controller.UploadToCOS)
	r.DELETE("api/file/deletefile", controller.DeleteFromCOS)
	r.GET("api/manager/GetClubDetailAct", controller.GetClubDetailAct)
	r.POST("/notice", controller.GetNotice)
	r.GET("/statistics", controller.GetStatistics)
	r.GET("/clubs/:year", controller.GetClubsByYear)
	r.GET("/activities/:year", controller.GetActivitiesByYear)
	r.GET("/getAS_CE", controller.GetAS_CE)
	r.POST("/noticemanage", controller.GetNoticemanage)
	r.POST("/deleteNotice", controller.DeleteNotice)
	r.POST("/addNotice", controller.AddNotice)
	r.GET("/deletedCERecord", controller.DeletedCERecord)
	r.GET("/deletedASRecord", controller.DeletedASRecord)
	r.POST("api/manager/ReleaseAS", controller.ReleaseAS)
	r.POST("api/manager/ReleaseCE", controller.ReleaseCE)
	r.POST("/api/markAsRead", controller.MarkAsRead)
	r.POST("/api/file/updatefile", controller.UpdateFile)
	r.POST("/api/changePassword", controller.UpdatePassword)
	r.POST("/register", controller.Register)
	r.GET("api/manager/GetManageASCE", controller.GetManageASCE)
	r.POST("api/manager/uploadCEFile", controller.UploadCEFile)
	r.POST("api/manager/uploadASFile", controller.UploadASFile)
	return r
}
